// pages/monitor/monitor.js
Page({
  data: {
    options: ['测皮肤', '测体态', '测眼球', '测口腔'],
    selectedIndex: -1,
    scrollIntoViewId: '',// 用于控制滚动到特定元素的id


    currentImage:'/images/正视图.png',
    
  },

  jump2Event(e){
    const data = e.currentTarget.dataset,
          currentNav = this.data.navList.filter(item => item.id == data.id)[0];
    if(currentNav['path']) {

      wx.reLaunch({
        url: currentNav['path'],
      })
    
    // if end
    }
  },

  onOptionTap: function(e) {
    const index = e.currentTarget.dataset.index;
    const id = 'item-' + index; // 获取被点击元素的id

    // 更新选中项和滚动到该元素
    this.setData({
      selectedIndex: index,
      scrollIntoViewId: id
    });
  },
  gotoIndex(){
    wx.navigateTo({ 
    url: '/pages/index/index', 
    routeType: 'routeType', 
    success: (result) => {}, 
    fail: (res) => {}, 
    complete: (res) => {}, 
  }); 
  },
  
  switchImage1:function(){
    this.setData({
      currentImage:'/images/侧视图.png'
    });
  },
  switchImage2:function(){
    this.setData({
      currentImage:'/images/正视图.png'
    });
  }

})